package main

import "fmt"

func main() {
	var myMap map[string]int
	if myMap == nil {
		fmt.Println("map is nil")
	}

	myMap = make(map[string]int, 10)

	myMap["apple"] = 20
	myMap["banana"] = 50
	myMap["pear"] = 100

	fmt.Println(myMap)

	myMap2 := make(map[string]string)
	myMap2["apple"] = "app"
	myMap2["banana"] = "banana"
	fmt.Println(myMap2)

	myMap3 := map[string]string{
		"apple":  "app",
		"banana": "ban",
		"pear":   "pe",
	}
	fmt.Println(myMap3)

	fmt.Println("-----------------")

	for key, value := range myMap2 {
		fmt.Println(key, value)
	}

	delete(myMap2, "banana")
	myMap2["apple"] = "app1111"
	addLondon(myMap2)

	for key, value := range myMap2 {
		fmt.Println(key, value)
	}
}

func addLondon(cityMap map[string]string) {
	cityMap["London"] = "America"
}
